import time
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait

driver=webdriver.Chrome()
driver.get('https://www.baidu.com')
time.sleep(3)

# print(driver.title)
result1=WebDriverWait(driver,5,poll_frequency=1).until(EC.title_is("百度一下，你就知道"), message="超时")
print(result1)


kw =WebDriverWait(driver,5).until(EC.presence_of_element_located((By.ID,"kw")))
# *拆包
t1 =(By.ID,'kw')
t2 =[By.ID,'kw']
kw1=driver.find_element(*t1)
print(kw1.get_attribute('outerHTML'))

driver.quit()